package com.tqq.onlinetest.controller;

import com.tqq.onlinetest.pojo.TeacherInfo;
import com.tqq.onlinetest.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/TeacherController")
@CrossOrigin(origins = "*",maxAge = 3600)
public class TeacherController {

    @Autowired
    TeacherService teacherService;

    @ResponseBody
    @RequestMapping("/updateTeacher")
    public boolean updateTeacher(TeacherInfo teacherInfo){
        return teacherService.updateTeacherInfo(teacherInfo);
    }


    @ResponseBody
    @RequestMapping("/getTeacherInfoById")
    public TeacherInfo getTeacherInfoById(String teacherId){
        return teacherService.getTeacherInfoById("teacherId");
    }
    @ResponseBody
    @RequestMapping("/test")
    public int test(int pa){
        return pa*2;
    }
}
